package com.hdax.dm.feign.scheduler;

import com.hdax.dm.entity.scheduler.DmScheduler;
import com.hdax.dm.entity.scheduler.DmSchedulerSeat;
import com.hdax.dm.entity.scheduler.DmSchedulerSeatPrice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name="dm-scheduler-provider")
public interface DmSchedulerFeign {

    /**
     * 查询节目的演出场次
     * @param itemId
     * @return
     */
    @PostMapping(path = "/rest/scheduler/byItem")
    List<DmScheduler> getSchedulersByItem(@RequestParam("itemId")Long itemId);

    /**
     * 获取每场演出的座位价格
     * @param schedulerId
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeatPrice/getPrice")
    List<DmSchedulerSeatPrice> getPrice(@RequestParam(value = "schedulerId")Long schedulerId);

    /**
     * 查询演出场次对应座位的剩余数量
     * @param scheduleId
     * @param areaLevel
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat/seatCount")
    Long seatCount(@RequestParam("scheduleId")Long scheduleId,@RequestParam("areaLevel")Long areaLevel);

    /**
     * 根据排期查询座位信息
     * @param scheduleId
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat//getSeat")
    List<DmSchedulerSeat> getSeat(@RequestParam("scheduleId")Long scheduleId);

    /**
     * 查询排期座位信息
     * @param scheduleId
     * @param x
     * @param y
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat/getScheduleSeat")
    DmSchedulerSeat getScheduleSeat(@RequestParam("scheduleId")Long scheduleId,
                                    @RequestParam("x")Long x,@RequestParam("y")Long y);

    /**
     * 修改排期座位信息
     * @param dmSchedulerSeat
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat/updateScheduleSeat")
    int updateScheduleSeat(@RequestBody DmSchedulerSeat dmSchedulerSeat);

    /**
     * 查询排期座位信息根据订单编号
     * @param orderNo
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat/getScheduleSeatbyOrderNo")
    List<DmSchedulerSeat> getScheduleSeatbyOrderNo(@RequestParam("orderNo")String orderNo);

    /**
     * 自定义修改排期座位
     * @param dmSchedulerSeat
     * @return
     */
    @PostMapping(path = "/rest/schedulerSeat/hyupdateScheduleSeat")
    int hyupdateScheduleSeat(@RequestBody String orderNo);

}
